﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using dis.sys.hw1.Model;

namespace dis.sys.hw1.Contract
{
    // interface of the hotel side server
    [ServiceKnownType(typeof(Hotel))]
    [ServiceKnownType(typeof(HotelRoom))]
    [ServiceContract]
    public interface IHotelService
    {
        [MethodImpl(MethodImplOptions.Synchronized)]
        [OperationContract]
        Hotel GetAvailableRooms(string hotelName, DateTime fromDate, DateTime toDate, double minStars, double minRating);

        [MethodImpl(MethodImplOptions.Synchronized)]
        [OperationContract]
        int BookRoom(string hotelName, DateTime fromDate, DateTime toDate, int roomNumber);

        [MethodImpl(MethodImplOptions.Synchronized)]
        [OperationContract]
        bool Cancel(string hotelName, int bookingId);

        [OperationContract]
        IEnumerable<string> GetHotelNames();

        [OperationContract]
        double GetStars(string hotelName);

        [OperationContract]
        double GetRating(string hotelName);

        [OperationContract]
        bool IsHotelInQueryRange(string hotelName, double minStars, double minRating);

        [OperationContract]
        bool AddHotelToBackUp(IDictionary<string, Hotel> data);
    }
}
